package cn.com.ejiakanghu.dto;

import org.linlinjava.litemall.db.domain.LitemallGoodsSpecification;

public class GoodsSpecItemInfo {
    /**
     * 规格ID，唯一
     */
    private int id;
    /**
     * 规格名称，例如：红色、蓝色、黄色
     */
    private String name;
    /**
     * 规格图片URL，图片宽高尺寸比例320x320
     */
    private String image;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public static GoodsSpecItemInfo getInstance(LitemallGoodsSpecification specification) {
        GoodsSpecItemInfo itemInfo = new GoodsSpecItemInfo();
        itemInfo.setId(specification.getId());
        itemInfo.setName(specification.getValue());
        itemInfo.setImage(specification.getPicUrl());
        return itemInfo;
    }
}
